using System;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using LeadTracker.Models;

namespace LeadTracker.Models.Tests.Generated
{
	public partial class LeadModelTests
	{

		
		[TestMethod]
		public void Title_PropertyWriteReadTest()
        {
	
			var objectUnderTest = CreateObject();

			//Setting the value to the current value should always work
			var originalValue = objectUnderTest.Title;
			objectUnderTest.Title = originalValue;
			Assert.AreEqual(originalValue, objectUnderTest.Title);


			//For each of the following, it should either work or throw an ArgumentException 

			try 
			{
				var expectedValue = (string)null;
				objectUnderTest.Title = expectedValue;
				Assert.IsTrue(objectUnderTest.Title == null || objectUnderTest.Title == "");
			}
			catch (ArgumentException) 
			{
				//OK
			}

			try 
			{
				var expectedValue = "";
				objectUnderTest.Title = expectedValue;
				Assert.AreEqual(expectedValue, objectUnderTest.Title);
			}
			catch (ArgumentException) 
			{
				//OK
			}

			try 
			{
				var expectedValue = "0";
				objectUnderTest.Title = expectedValue;
				Assert.AreEqual(expectedValue, objectUnderTest.Title);
			}
			catch (ArgumentException) 
			{
				//OK
			}
			
			try 
			{
				var expectedValue = "1";
				objectUnderTest.Title = expectedValue;
				Assert.AreEqual(expectedValue, objectUnderTest.Title);
			}
			catch (ArgumentException) 
			{
				//OK
			}

			for (int i = 0; i < 100; i++)
			{
				try 
				{
					var expectedValue = new String('a', i);
					objectUnderTest.Title = expectedValue;
					Assert.AreEqual(expectedValue, objectUnderTest.Title);
				}
				catch (ArgumentException) 
				{
					//OK
				}
			}
        }


	}
}
